﻿<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/select2/dist/css/select2.css">
    <link rel="stylesheet" href="/static/jquery-ui/jquery-ui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/admin.css">
    <link rel="stylesheet" href="/static/ztree3/css/bootstrapStyle/bootstrapStyle.css" type="text/css">

    <title>webssh</title>

    <script src="/static/js/echarts.min.js"  ></script>

  </head>

  <body>


<!--用户信息-->
<div class="panel panel-default" style="min-width:1300px;">
  <div class="panel-heading">
      <div class="row" style="padding-top:5px;padding-left:10px;">
           <div class="col-sm-3">

                <ol class="breadcrumb" style="margin-bottom: 0px;">
                  <li><a href="/" style="color: #377CD8;">运维工具</a></li>
                  <li class="active" id="cur-host">{{ cur_host }}</li>
                </ol>
          </div>

          <div class="col-sm-2">


              <input type="file" class="form-control" id="upfile">


          </div>

          <div class="col-sm-2">

              <div class="input-group">
                  <span class="input-group-addon" id="basic-addon1">path</span>

                  <input type="text" class="form-control" placeholder="/" id="up-path" value="/opt/upload/">
                  <span class="input-group-btn">
                    <button class="btn btn-info" type="button" id="btn-upfile">上传</button>
                  </span>
              </div>
          </div>

          <div class="col-sm-3" >
              <div class="input-group">
                  <span class="input-group-addon">path</span>

                  <input type="text" class="form-control" placeholder="/PATH/TO/filename" id="down-path">

                  <span class="input-group-btn">
                    <button class="btn btn-success" type="button" id="btn-downfile">下载</button>
                  </span>
              </div>

          </div>


      </div>

  </div>
  <div class="panel-body">

        <div class="row">
            <div class="col-sm-2" style="max-height:800px;overflow:auto;">

                <ul id="treeDemo" class="ztree"></ul>

            </div>

            <div class="col-sm-10" id="viewDiv">


            </div>

        </div>

  </div>
</div>


<script src="/static/js/jquery-3.2.1.min.js"></script>
<script src="/static/js/bootstrap.min.js"  ></script>
<script src="/static/jquery-ui/jquery-ui.js"  ></script>
<script src="/static/js/base.js"></script>
<script src="/static/select2/dist/js/select2.js"></script>
<script type="text/javascript" src="/static/ztree3/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/static/ztree3/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/static/ztree3/js/jquery.ztree.exedit.js"></script>
<script type="text/javascript" src="/static/js/tool_v2.js"></script>
<script type="text/javascript" >



var setting = {
        view: {
            selectedMulti: false
        },
        check: {
            enable: false
        },
        data: {
            simpleData: {
                enable: true
            }
        },
        edit: {
            enable: false
        }
    };


    var zNodes = {{ znodes_data |safe }};

    $(document).ready(function(){
        $.fn.zTree.init($("#treeDemo"), setting, zNodes);

        $("a[class='level1']").click(function(){

            var ip = $(this).attr("title");

            $("#cur-host").empty();
            $("#cur-host").append(ip);

            $.post("/tool/webssh/",{"ip":ip},function(data){
                load_home()
            })

        });

    });


    document.getElementById("viewDiv").innerHTML = '<object type="text/html" data="{{ webssh_url }}" width="100%" height="800px"></object>';


    function load_home() {
        document.getElementById("viewDiv").innerHTML = '<object type="text/html" data="{{ webssh_url }}" width="100%" height="800px"></object>';
      }



</script>
</body>

</html>



